/*////////////////////////////////////////////////////////////////////////
*
*  Project:      mapgen
*  Description:  Map Generator for Planet Wars at http://ai-contest.com/.
*  Author:       Copyright (C) 2010 Alexander Makodzeba
*  License:      GPLv3
*
*  This file is part of mapgen.
*
*  mapgen is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  mapgen is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with mapgen.  If not, see <http://www.gnu.org/licenses/>.
*
////////////////////////////////////////////////////////////////////////*/

#include "StdAfx.h"
#include "PlanetData.h"

//////////////////////////////////////////////////////////////////////////
// writing PlanetData to stringstream
std::stringstream& operator<< (std::stringstream& ss, PlanetData planet)
{
	ss << std::setprecision(12);
	ss << "P" << " " 
		<< planet.position.x << " " 
		<< planet.position.y << " "
		<< planet.owner << " " 
		<< planet.population << " "
		<< planet.size;
	return ss;
}

//////////////////////////////////////////////////////////////////////////
// returns string representation of PlanetData
std::string PlanetData::ToString()
{
	std::stringstream ss;
	ss << *this;
	return ss.str();
}

